#    pythonequations is a collection of equations expressed as Python classes
#    Copyright (C) 2008 James R. Phillips
#    2548 Vera Cruz Drive
#    Birmingham, AL 35235 USA
#    email: zunzun@zunzun.com
#
#    License: BSD-style (see LICENSE.txt in main source directory)
#    Version info: $Id: TaylorSeries.py 274 2010-09-29 13:16:14Z zunzun.com $

import pythonequations, pythonequations.EquationBaseClasses, pythonequations.ExtraCodeForEquationBaseClasses
import numpy
numpy.seterr(all = 'raise') # numpy raises warnings, convert to exceptions to trap them


class TaylorA3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series A"
    _HTML = "z = a + bx + cy + dx<SUP>2</SUP> + fy<SUP>2</SUP> + gxy"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_XY(NameOrValueFlag=1), pythonequations.ExtraCodeForEquationBaseClasses.CG_XY, []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*x_in + c*y_in + d*pow(x_in, 2.0) + f*pow(y_in, 2.0) + g*x_in*y_in;\n"
        return s



class TaylorB3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series B"
    _HTML = "z = a + b*ln(x) + cy + d*ln(x)<SUP>2</SUP> + fy<SUP>2</SUP> + g*ln(x)*y"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX_Y(NameOrValueFlag=1), pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX_Y, []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in) + c*y_in + d*pow(log(x_in), 2.0) + f*pow(y_in, 2.0) + g*log(x_in)*y_in;\n"
        return s



class TaylorC3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series C"
    _HTML = "z = a + bx + c*ln(y) + dx<SUP>2</SUP> + f*ln(y)<SUP>2</SUP> + g*x*ln(y)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X_LogY(NameOrValueFlag=1), pythonequations.ExtraCodeForEquationBaseClasses.CG_X_LogY, []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*x_in + c*log(y_in) + d*pow(x_in, 2.0) + f*pow(log(y_in), 2.0) + g*x_in*log(y_in);\n"
        return s



class TaylorD3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series D"
    _HTML = "z = a + b*ln(x) + c*ln(y) + d*ln(x)<SUP>2</SUP> + f*ln(y)<SUP>2</SUP> + g*ln(x)*ln(y)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX_LogY(NameOrValueFlag=1), pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX_LogY, []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*x_in + c*y_in + d*pow(x_in, 2.0) + f*pow(y_in, 2.0) + g*x_in*y_in;\n"
        return s



class TaylorE3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series E"
    _HTML = "z = a + b/x + cy + d/x<SUP>2</SUP> + fy<SUP>2</SUP> + gy/x"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX_PowY(NameOrValueFlag=1, args=[-1.0, 1.0]), [-1.0, 1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/x_in + c*y_in + d/pow(x_in, 2.0) + f*pow(y_in, 2.0) + g*y_in/x_in;\n"
        return s



class TaylorF3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series F"
    _HTML = "z = a + b/ln(x) + cy + d/ln(x)<SUP>2</SUP> + fy<SUP>2</SUP> + gy/ln(x)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Y(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX_PowY(NameOrValueFlag=1, args=[-1.0, 1.0]), [-1.0, 1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/log(x_in) + c*y_in + d/pow(log(x_in), 2.0) + e*pow(y_in, 2.0) + f*y_in/log(x_in);\n"
        return s



class TaylorG3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series G"
    _HTML = "z = a + b/x + c*ln(y) + d/x<SUP>2</SUP> + f*ln(y)<SUP>2</SUP> + g*ln(y)/x"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX_PowLogY(NameOrValueFlag=1, args=[-1.0, 1.0]), [-1.0, 1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/x_in + c*log(y_in) + d/pow(x_in, 2.0) + f*pow(log(y_in), 2.0) + g*log(y_in)/x_in;\n"
        return s



class TaylorH3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series H"
    _HTML = "z = a + b/ln(x) + c*ln(y) + d/ln(x)<SUP>2</SUP> + f*ln(y)<SUP>2</SUP> + g*ln(y)/ln(x)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogY(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX_PowLogY(NameOrValueFlag=1, args=[-1.0, 1.0]), [-1.0, 1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/log(x_in) + c*log(y_in) + d/pow(log(x_in), 2.0) + f*pow(log(y_in), 2.0) + g*log(y_in)/log(x_in);\n"
        return s



class TaylorI3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series I"
    _HTML = "z = a + bx + c/y + dx<SUP>2</SUP> + f/y<SUP>2</SUP> + gx/y"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX_PowY(NameOrValueFlag=1, args=[1.0, -1.0]), [1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*x_in + c/y_in + d*pow(x_in, 2.0) + f/pow(y_in, 2.0) + g*x_in/y_in;\n"
        return s



class TaylorJ3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series J"
    _HTML = "z = a + b*ln(x) + c/y + d*ln(x)<SUP>2</SUP> + f/y<SUP>2</SUP> + g*ln(x)/y"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    CannotAcceptDataWithZeroY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX_PowY(NameOrValueFlag=1, args=[1.0, -1.0]), [1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in) + c/y_in + d*pow(log(x_in), 2.0) + f/pow(y_in, 2.0) + g*log(x_in)/y_in;\n"
        return s



class TaylorK3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series K"
    _HTML = "z = a + bx + c/ln(y) + dx<SUP>2</SUP> + f/ln(y)<SUP>2</SUP> + gx/ln(y)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX_PowLogY(NameOrValueFlag=1, args=[1.0, -1.0]), [1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*x_in + c/log(y_in) + d*pow(x_in, 2.0) + f/pow(log(y_in), 2.0) + g*x_in/log(y_in);\n"
        return s



class TaylorL3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series L"
    _HTML = "z = a + b*ln(x) + c/ln(y) + d*ln(x)<SUP>2</SUP> + f/ln(y)<SUP>2</SUP> + g*ln(x)/ln(y)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX_PowLogY(NameOrValueFlag=1, args=[1.0, -1.0]), [1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in) + c/log(y_in) + d*pow(log(x_in), 2.0) + f/pow(log(y_in), 2.0) + g*log(x_in)/log(y_in);\n"
        return s



class TaylorM3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series M"
    _HTML = "z = a + b/x + c/y + d/x<SUP>2</SUP> + f/y<SUP>2</SUP> + g/(xy)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithZeroY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX_PowY(NameOrValueFlag=1, args=[-1.0, -1.0]), [-1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/x_in + c/y_in + d/pow(x_in, 2.0) + f/pow(y_in, 2.0) + g/(x_in*y_in);\n"
        return s



class TaylorN3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series N"
    _HTML = "z = a + b/ln(x) + c/y + d/ln(x)<SUP>2</SUP> + f/y<SUP>2</SUP> + g/(ln(x)*y)"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    CannotAcceptDataWithZeroY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX_PowY(NameOrValueFlag=1, args=[-1.0, -1.0]), [-1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/log(x_in) + c/y_in + d/pow(log(x_in), 2.0) + f/pow(y_in, 2.0) + g/(log(x_in)*y_in);\n"
        return s



class TaylorO3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series O"
    _HTML = "z = a + b/x + c/ln(y) + d/x<SUP>2</SUP> + f/ln(y)<SUP>2</SUP> + g/(x*ln(y))"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX_PowLogY(NameOrValueFlag=1, args=[-1.0, -1.0]), [-1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/x_in + c/log(y_in) + d/pow(x_in, 2.0) + f/pow(log(y_in), 2.0) + g/(x_in*log(y_in));\n"
        return s



class TaylorP3D(pythonequations.EquationBaseClasses.Equation3D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name ="Taylor Series P"
    _HTML = "z = a + b/ln(x) + c/ln(y) + d/ln(x)<SUP>2</SUP> + f/ln(y)<SUP>2</SUP> + g/(ln(x)*ln(y))"
    coefficientDesignatorTuple = ("a", "b", "c", "d", "f", "g")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    CannotAcceptDataWithZeroY = True
    CannotAcceptDataWithNegativeY = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-1.0]), [-1.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogY(NameOrValueFlag=1, args=[-2.0]), [-2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX_PowLogY(NameOrValueFlag=1, args=[-1.0, -1.0]), [-1.0, -1.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b/log(x_in) + c/log(y_in) + d/pow(log(x_in), 2.0) + f/pow(log(y_in), 2.0) + g/(log(x_in)*log(y_in));\n"
        return s
